package com.ushine.web.base.model.relation;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ushine.web.base.model.base.BaseBO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @Author: yls
 * @Date: 2021/3/3 9:38
 * @Description: 角色权限表
 * @Version 1.0
 */
@EqualsAndHashCode(callSuper = true)
@Entity
@Data
@ApiModel(description = "角色权限表")
@Table(name = "t_system_role_function_permission")
@org.hibernate.annotations.Table(appliesTo = "t_system_role_function_permission", comment = "角色权限表")
@TableName(value = "t_system_role_function_permission")
public class RoleAndFunctionPermissionDO extends BaseBO implements Serializable {
    /**
     * 角色编号
     * // 解决前台js接收雪花id精度丢失问题
     * JsonFormat(shape = JsonFormat.Shape.STRING)
     */
    @Id
    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty("编号")
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @Column(name = "id", columnDefinition = "bigint comment '编号'")
    private Long id;


    @ApiModelProperty("角色编号")
    @Column(name = "role_id", columnDefinition = "bigint comment '角色编号'")
    @NotNull(message = "角色编号不能为空")
    private Long roleId;

    /**
     * 权限编号
     */
    @ApiModelProperty("权限编号")
    @Column(name = "function_permission_id", columnDefinition = "bigint comment '权限编号'")
    @NotNull(message = "权限编号不能为空")
    private Long functionPermissionId;

}
